<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2017-2025 Steinar Bang                                                -->
<!--                                                                                 -->
<!-- Licensed under the Apache License, Version 2.0 (the "License");                 -->
<!-- you may not use this file except in compliance with the License.                -->
<!-- You may obtain a copy of the License at                                         -->
<!--   http://www.apache.org/licenses/LICENSE-2.0                                    -->
<!-- Unless required by applicable law or agreed to in writing,                      -->
<!-- software distributed under the License is distributed on an "AS IS" BASIS,      -->
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.        -->
<!-- See the License for the specific language governing permissions and limitations -->
<!-- under the License.                                                              -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xml:space="preserve">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>no.priv.bang.sonar.sonar-collector</groupId>
        <artifactId>sonar-collector</artifactId>
        <version>2.5.34-SNAPSHOT</version>
    </parent>
    <artifactId>sonar-collector-webhook</artifactId>

    <name>SonarQube data collector webhook</name>
    <description>An apache karaf microservice to capture SonarQube/SonarCloud key measures and save statistics to a PostgreSQL database.</description>

    <properties>
        <karaf-feature-name>sonar-collector-webhook</karaf-feature-name>
        <Bundle-SymbolicName>no.priv.bang.sonar.${project.artifactId}</Bundle-SymbolicName>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- override inherited derby version -->
            <dependency>
                <groupId>org.apache.derby</groupId>
                <artifactId>derby</artifactId>
                <version>${derby.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>no.priv.bang.osgi.service.adapters</groupId>
            <artifactId>service-mocks</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.component.annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.log</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>no.priv.bang.osgi.service.adapters</groupId>
            <artifactId>adapters.logservice</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>no.priv.bang.osgi.service.adapters</groupId>
            <artifactId>adapters.logservice</artifactId>
            <type>xml</type>
            <classifier>features</classifier>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.jdbc</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>no.priv.bang.osgi.service.adapters</groupId>
            <artifactId>adapters.jdbc</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>no.priv.bang.osgi.service.adapters</groupId>
            <artifactId>adapters.jdbc</artifactId>
            <type>xml</type>
            <classifier>features</classifier>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.web</groupId>
            <artifactId>pax-web-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.web</groupId>
            <artifactId>pax-web-extender-whiteboard</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derby</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derbytools</artifactId>
            <version>${derby.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>no.priv.bang.karaf</groupId>
            <artifactId>liquibase-core-karaf</artifactId>
            <type>xml</type>
            <classifier>features</classifier>
        </dependency>
        <dependency>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>no.priv.bang.karaf</groupId>
            <artifactId>karaf.liquibase.runner</artifactId>
            <type>xml</type>
            <classifier>features</classifier>
        </dependency>
        <dependency>
            <groupId>no.priv.bang.karaf</groupId>
            <artifactId>karaf.liquibase.runner</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Export-Package>no.priv.bang.sonar.collector.webhook;uses:="com.fasterxml.jackson.databind,javax.servlet,javax.servlet.http,javax.sql,org.osgi.service.log";version="1.4.0"</Export-Package>
                        <Import-Package>
                            com.fasterxml.jackson.core,
                            org.osgi.service.log;version="[1.4,2)",
                            *
                        </Import-Package>
                        <Include-Resource>
                            /=target/classes/,
                            /www.liquibase.org/=target/dependency/www.liquibase.org/
                        </Include-Resource>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <configuration>
                    <includeTransitiveDependency>true</includeTransitiveDependency>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-liquibase-xsd</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.liquibase</groupId>
                                    <artifactId>liquibase-core</artifactId>
                                </artifactItem>
                            </artifactItems>
                            <includes>**/dbchangelog-${liquibase.xsd-version}.xsd</includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
